Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple applications push and pull API #15396

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Multiple applications push and pull API #15396

merged 1 commit into from
Nov 22, 2023

Conversation

GnsP
Copy link
Contributor

@GnsP GnsP commented Oct 31, 2023

Add API endpoints for multiple applications push and pull.
Also restrict one multi operation at a time.

@GnsP GnsP added build Triggers github actions build 6.10 labels Nov 1, 2023
@GnsP GnsP changed the base branch from multi-push-operation to develop November 1, 2023 02:26
@GnsP GnsP force-pushed the scm-multi-api branch 4 times, most recently from eae55a2 to bb42d83 Compare November 2, 2023 07:55
@GnsP GnsP force-pushed the scm-multi-api branch 2 times, most recently from cf2eb52 to aaf1135 Compare November 14, 2023 04:10
@samdgupi samdgupi force-pushed the scm-multi-api branch 7 times, most recently from a49969c to 26bedd5 Compare November 20, 2023 04:11
@samdgupi samdgupi changed the title Scm multiple applications push and pull API (synchronous) Scm multiple applications push and pull API Nov 20, 2023
@samdgupi samdgupi changed the title Scm multiple applications push and pull API Multiple applications push and pull API Nov 20, 2023
@samdgupi samdgupi force-pushed the scm-multi-api branch 2 times, most recently from cc03fd1 to 5afbcc8 Compare November 20, 2023 11:49
@samdgupi samdgupi changed the base branch from develop to operation-fixes November 20, 2023 11:50
@samdgupi samdgupi force-pushed the scm-multi-api branch 2 times, most recently from d614228 to ae99a92 Compare November 20, 2023 19:20
Copy link
Contributor

@albertshau albertshau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments, otherwise lgtm

try {
appsRequest = parseBody(request, PushMultipleAppsRequest.class);
} catch (JsonSyntaxException e) {
throw new BadRequestException("Invalid request body.", e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this particular case we want to include e.getMessage() in the error message, since that is what gets displayed to the user.

Note that this is not always what we want, especially for non-user facing exceptions, as that leads to duplicate logging.

TransactionRunners.run(transactionRunner, context -> {
validateOnlyOneGitOperationRunning(namespace, context);
getOperationRunStore(context).createOperationRun(operationRunId, detail);
statePublisher.publishStarting(operationRunId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that it is possible to publish multiple starting messages if this transaction fails and is retried. Though I think the subscriber handles that case so it's not an issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah publishing multiple messages should not be an issue here as subscriber will effectively deduplicate it

@samdgupi samdgupi force-pushed the operation-fixes branch 2 times, most recently from 4d4c682 to 888aa26 Compare November 21, 2023 13:25
Base automatically changed from operation-fixes to develop November 21, 2023 15:44
@samdgupi samdgupi merged commit 05cdf81 into develop Nov 22, 2023
10 of 11 checks passed
@samdgupi samdgupi deleted the scm-multi-api branch November 22, 2023 06:38
samdgupi added a commit that referenced this pull request Nov 22, 2023
[🍒] Add APIs to do multi pull/push from #15396
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.10 build Triggers github actions build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants